﻿using System;
using net.entity.framework.common;
using net.entity.framework.query;

namespace net.entity.framework {
    public abstract class EqlEntity {
        #region Members

        /// <summary>
        /// To be used by children of EqlEntity
        /// </summary>
        protected readonly AliasInfo aliasInfo;

        #endregion

        #region Properties

        public Terminal IsDeleted {
            get {
                return Terminal.Create(aliasInfo, "isDeleted", typeof (bool),
                                       Utils.GetPropertyInfoFromExample(() => ((Entity) null).IsDeleted));
            }
        }

        internal Terminal Id {
            get {
                return Terminal.Create(aliasInfo, "id", typeof (int),
                                       Utils.GetPropertyInfoFromExample(() => ((Entity) null).Id));
            }
        }

        internal Terminal TypeId {
            get {
                return Terminal.Create(aliasInfo, "typeId", typeof (int),
                                       Utils.GetPropertyInfoFromExample(() => ((Entity) null).TypeId));
            }
        }

        internal Terminal Revision {
            get {
                return Terminal.Create(aliasInfo, "revision", typeof (int),
                                       Utils.GetPropertyInfoFromExample(() => ((Entity) null).Revision));
            }
        }

        public Terminal Creator {
            get {
                return Terminal.Create(aliasInfo, "creator", typeof (string),
                                       Utils.GetPropertyInfoFromExample(() => ((Entity) null).Creator));
            }
        }

        public Terminal TimeStamp {
            get {
                return Terminal.Create(aliasInfo, "timeStamp", typeof (DateTime),
                                       Utils.GetPropertyInfoFromExample(() => ((Entity) null).TimeStamp));
            }
        }

        #endregion

        #region Constructor

        protected EqlEntity(AliasInfo aliasInfo) {
            this.aliasInfo = aliasInfo;
        }

        #endregion
    }
}